import { trigger, state, style, animate, transition, keyframes, group, query, stagger } from '@angular/animations';

export const listAnimation = trigger('listAnimation', [

    // 从任意状态 到 任意状态
    transition('*=>*', [
        //进场动画
        query(':enter', style({ opacity: 0 }), { optional: true }),
        query(':enter', stagger(100, [
            animate('1s', style({ opacity: 1 }))
        ]), { optional: true }),
        //离厂动画
        query(':leave', style({ opacity: 1 }), { optional: true }),
        query(':leave', stagger(100, [
            animate('1s', style({ opacity: 0 }))
        ]), { optional: true }),
    ])
]);